<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>申请操作详情</title>
    <script src="{{ env('CDN_DOMAIN_NAME') }}/js/commonjs/rem.js"></script>
    <link rel="stylesheet" type="text/css" href="{{ env('CDN_DOMAIN_NAME') }}/css/commoncss/common.css"/>
    <link rel="stylesheet" type="text/css" href="{{ env('CDN_DOMAIN_NAME') }}/css/push.css"/>
</head>
<script src="{{ env('CDN_DOMAIN_NAME') }}/js/commonjs/iscroll.js"></script>
<script src="{{ env('CDN_DOMAIN_NAME') }}/js/app.js"></script>
<script src="{{ env('CDN_DOMAIN_NAME') }}/js/commonjs/common.js"></script>
<body>
<div >
    <div class="wrap">
        <div class="push">

                    <ul class="push_main">
                        <li class="push_li">
                            <span class="push_sp1">申请人:</span>
                            <span class="push_sp2">{{ $data->admin_name }}</span>
                        </li>
                        <li class="push_li">
                            <span class="push_sp1">联系方式:</span>
                            <span class="push_sp2">{{ $data->admin_tel }}</span>
                        </li>
                        <li class="push_li">
                            <span class="push_sp1">申请时间:</span>
                            <span class="push_sp2">{{ $date }}</span>
                        </li>
                        <li class="push_li">
                            <span class="push_sp1">申请操作:</span>
                            <span class="push_sp2">设置操作比例为:{{ $scale}}</span>
                        </li>
                        <li class="push_li" >
                            <button class="btn1 push_btn" value="1">同意</button>
                            <button class="btn2 push_btn" value="2">拒绝</button>
                        </li>
                    </ul>
        </div>
    </div>
    <div class="push_mask" style="display:none;"></div>
    <div class="push_div" style="display:none;">
        <p class="push_p1">操作成功!</p>
        <p class="push_p2">确定</p>
    </div>
    <meta name="csrf_token" id="token" content="{{ csrf_token() }}">
</div>
</body>
<script>
    scroll();
    $('.push_btn').click(function () {
        var val = $(this).val();
        var id = '{{$data->id}}';
        var name = '{{$data->admin_name}}';
        alert(id);
        var model = $(this);
        $.ajax({
            url:'/allowOption',
            type:'POST',
            data:{'val':val,'id':id,'name':name},
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')
            },
            dataType:'json',
            success:function(data){
                if(data.success == true)
                {
                    model.parent().parent('.push_main').remove();
                    $('.push_mask').show();
                    $('.push_div').show();
                }else{
                    alert(data.msg);
                }

            }
        })
    })
    $('.push_p2').click(function () {
        $('.push_mask').hide();
        $('.push_div').hide();
    })
</script>
</html>
